package com.ruoyi.recycle.dto;

import cn.hutool.core.date.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * 培训视频对象 train_video
 *
 * @author Wubk
 * @date 2022-05-22
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@ApiModel("培训视频搜索请求体")
public class TrainVideoDTO {
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    private Long id;

    /**
     * 标题
     */
    @ApiModelProperty(name = "name", value = "视频名称")
    private String name;

    /**
     * 视频链接
     */
    @ApiModelProperty(name = "name", value = "视频名称")
    private String url;

    /**
     * 分类
     */
    @ApiModelProperty(name = "name", value = "视频名称")
    private String type;

    /**
     * 创建人
     */
    private String createdBy;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date searchTimeBegin;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date searchTimeEnd;

    /**
     * 更新人
     */
    private String updatedBy;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date updatedTime;

    private Integer currentPage = 1;

    private Integer pageSize = 10;

    public void setSearchTimeEnd(Date searchEnd) {
        this.searchTimeEnd = DateUtil.offsetSecond(searchEnd, 86399).toJdkDate();

    }
}
